<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //BOM编程 属于浏览器的窗口通过window进行调用相对应的API 也可以省略掉
    console.log(window.location)
    console.log(window.closed)
    //在五大浏览器中用不了，需要进行设置
    console.log(window.deaultStatus)
    //设置定时器
    var timeout = setTimeout(fn1, 3000);
    //清除定时器
    clearTimeout(timeout)

    function fn1() {
        console.log("定时器执行了")
    }

    function fn2() {
        console.log("延时器执行了")
    }

    //设置延时器
    var interval = setInterval(fn2, 2000);
    //清除延时器
    clearInterval(interval)

    clearInterval(setInterval(fn2, 2000))
</script>
</body>
</html>